package com.ying.dao.order;

import com.ying.po.order.Wrap;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;

public interface WrapRepository extends JpaRepository<Wrap, Integer> {


    @Query(value = "select * from t_wrap where IS_DELETE=0", nativeQuery = true)
    public Page<Wrap> getWrapPageIsNotDeleted(Pageable pageable);

    @Query(value = "select * from t_wrap where IS_DELETE=0", nativeQuery = true)
    public List<Wrap> findAllIsNotDelete();


    @Query(value = "select * from t_wrap where is_delete=0 and id=?1", nativeQuery = true)
    public Optional<Wrap> findByIdAndIsNotDelete(Integer id);

}
